Torrent

object Torrent(source)

Types

Link copied to clipboard
data class TorrentFileStat(val id: Int?, val path: String?, val length: Long?)
Link copied to clipboard
data class TorrentRequest(val action: String, val hash: String = "", val link: String = "", val title: String = "", val poster: String = "", val data: String = "", val saveToDB: Boolean = false)
Link copied to clipboard
data class TorrentStatus(var title: String, var poster: String, var data: String?, var timestamp: Long, var name: String?, var hash: String?, var stat: Int, var statString: String, var loadedSize: Long?, var torrentSize: Long?, var preloadedBytes: Long?, var preloadSize: Long?, var downloadSpeed: Double?, var uploadSpeed: Double?, var totalPeers: Int?, var pendingPeers: Int?, var activePeers: Int?, var connectedSeeders: Int?, var halfOpenPeers: Int?, var bytesWritten: Long?, var bytesWrittenData: Long?, var bytesRead: Long?, var bytesReadData: Long?, var bytesReadUsefulData: Long?, var chunksWritten: Long?, var chunksRead: Long?, var chunksReadUseful: Long?, var chunksReadWasted: Long?, var piecesDirtiedGood: Long?, var piecesDirtiedBad: Long?, var durationSeconds: Double?, var bitRate: String?, var fileStats: List<Torrent.TorrentFileStat>?, var trackers: List<String>?)

Functions

Link copied to clipboard
suspend fun clearAll(): Boolean

Removes all torrents from the server, and returns if it is successful

Link copied to clipboard

Cleans up both old aria2c files and newer go server, (even if the new is also self cleaning)

Link copied to clipboard
suspend fun get(hash: String): Torrent.TorrentStatus

Gets all the metadata of a torrent, will throw if that hash does not exists https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L126

Link copied to clipboard
suspend fun shutdown(): Boolean

Gracefully shutdown the server. should not be used because I am unable to start it again, and the stopTorrentServer() crashes the app

Link copied to clipboard

Transforms a torrent link into a streamable link via the server